<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<script>
    function ajax(){
        return new Promise((resolve,reject)=>{
            setTimeout(()=>{
                reject({status:'1'})
            },2000)
        })
    }
    async function test(){
        try {
            let res = await ajax()
            console.log(res,res.ddd)
            return res
        }catch(err){
            console.log('err',err)
        }

    }
    test().then(res=>{
        console.log('res',res)
    }).catch(err=>{
        console.log('err',err)
    })
</script>
</body>

</html>
